<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<body>
<style type="text/css">
	#tbClassHome{
		padding: 15px;
		background: #fff;
		border-radius: 10px;
	}
	.layui-inline{
		width:45%;
	}
	.layui-input-block{
		margin-left: 135px;
	}
	.layui-form-label{
		width: 100px;
	}
	
</style>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="yes">生成二维码</a>
</script>
<fieldset class="layui-elem-field layui-field-title site-title">
			<legend>
				<a name="fixbar">生成签到二维码</a>
			</legend>
		</fieldset>
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/javascript">
layui.use('table', function() {
	var table = layui.table;
	table.render({
		elem : '#test',
		url : 'checkingin/page1',
		id: 'idTest',
		cols : [ [ {
			field : 'id',
			title : 'ID',
			fixed : 'left',
			hide : true,
			unresize : true,
			sort : true
		}, {
			field : 'tbClass',
			title : '班级',
			align : 'center',
			templet : function(res) {
				return res.tbClass.name;
			}
		}, {
			field : 'curriculum',
			title : '课程',
			align : 'center',
			templet : function(res) {
				return res.curriculum.courseName;
			}
		}, {
			field : 'stringStarttime',
			title : '上课时间',
			align : 'center'
		}, {
			field : 'stringFinishttime',
			title : '下课时间',
			align : 'center'
		},{
			fixed : 'right',
			title : '功能',
			align : 'center',
			toolbar : '#barDemo'
		} ] ],
		page : true
	});
				
	table.on('rowDouble',function(obj){
	});
	//监听行工具事件
	table.on('tool(test)', function(obj) {
		var data = obj.data;
		if (obj.event === 'yes') {
			layer.open({
				type : 2,
				title:"签到二维码",
				shade : 0.3,
				shadeClose : true,
				anim : 5,
				content : 'checkingin/scerw?id=' + data.id,
				area : [ '550px', '550px' ]
			});
		}	
	});

});
</script>
</body>
</html>